Skip to content

Commit aa03efe

Browse files
authored
Merge pull request #261476 from MicrosoftDocs/repo_sync_working_branch
Confirm merge from repo_sync_working_branch to main to sync with https://github.com/MicrosoftDocs/azure-docs (branch main)
2 parents a018371 + 0188632 commit aa03efe

File tree

6 files changed

+84
-89
lines changed

6 files changed

+84
-89
lines changed

articles/ai-services/openai/includes/use-your-data-go.md

Lines changed: 79 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -36,91 +36,86 @@ ms.date: 08/29/2023
3636
package main
3737
3838
import (
39-
"context"
40-
"fmt"
41-
"log"
42-
"os"
43-
44-
"github.com/Azure/azure-sdk-for-go/sdk/ai/azopenai"
45-
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
39+
"context"
40+
"fmt"
41+
"log"
42+
"os"
43+
44+
"github.com/Azure/azure-sdk-for-go/sdk/ai/azopenai"
45+
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
46+
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
4647
)
47-
48+
4849
func main() {
49-
azureOpenAIKey := os.Getenv("AOAIKey")
50-
modelDeploymentID := os.Getenv("AOAIDeploymentId")
51-
52-
// Ex: "https://<your-azure-openai-host>.openai.azure.com"
53-
azureOpenAIEndpoint := os.Getenv("AOAIEndpoint")
54-
55-
// Azure AI Search configuration
56-
searchIndex := os.Getenv("SearchIndex")
57-
searchEndpoint := os.Getenv("SearchEndpoint")
58-
searchAPIKey := os.Getenv("SearchKey")
59-
60-
if azureOpenAIKey == "" || modelDeploymentID == "" || azureOpenAIEndpoint == "" || searchIndex == "" || searchEndpoint == "" || searchAPIKey == "" {
61-
fmt.Fprintf(os.Stderr, "Skipping example, environment variables missing\n")
62-
return
63-
}
64-
65-
keyCredential, err := azopenai.NewKeyCredential(azureOpenAIKey)
66-
67-
if err != nil {
68-
// TODO: Update the following line with your application specific error handling logic
69-
log.Fatalf("ERROR: %s", err)
70-
}
71-
72-
// In Azure OpenAI you must deploy a model before you can use it in your client. For more information
73-
// see here: https://learn.microsoft.com/azure/cognitive-services/openai/how-to/create-resource
74-
client, err := azopenai.NewClientWithKeyCredential(azureOpenAIEndpoint, keyCredential, nil)
75-
76-
if err != nil {
77-
// TODO: Update the following line with your application specific error handling logic
78-
log.Fatalf("ERROR: %s", err)
79-
}
80-
81-
resp, err := client.GetChatCompletions(context.TODO(), azopenai.ChatCompletionsOptions{
82-
Messages: []azopenai.ChatMessage{
83-
{Content: to.Ptr("What are the differences between Azure Machine Learning and Azure AI services?"), Role: to.Ptr(azopenai.ChatRoleUser)},
84-
},
85-
MaxTokens: to.Ptr[int32](512),
86-
AzureExtensionsOptions: &azopenai.AzureChatExtensionOptions{
87-
Extensions: []azopenai.AzureChatExtensionConfiguration{
88-
{
89-
// This allows Azure OpenAI to use an Azure AI Search index.
90-
//
91-
// > Because the model has access to, and can reference specific sources to support its responses, answers are not only based on its pretrained knowledge
92-
// > but also on the latest information available in the designated data source. This grounding data also helps the model avoid generating responses
93-
// > based on outdated or incorrect information.
94-
//
95-
// Quote from here: https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/use-your-data
96-
Type: to.Ptr(azopenai.AzureChatExtensionTypeAzureCognitiveSearch),
97-
Parameters: azopenai.AzureCognitiveSearchChatExtensionConfiguration{
98-
Endpoint: &searchEndpoint,
99-
IndexName: &searchIndex,
100-
Key: &searchAPIKey,
101-
},
102-
},
103-
},
104-
},
105-
Deployment: modelDeploymentID,
106-
}, nil)
107-
108-
if err != nil {
109-
// TODO: Update the following line with your application specific error handling logic
110-
log.Fatalf("ERROR: %s", err)
111-
}
112-
113-
// Contains contextual information from your Azure chat completion extensions, configured above in `AzureExtensionsOptions`
114-
msgContext := resp.Choices[0].Message.Context
115-
116-
fmt.Fprintf(os.Stderr, "Extensions Context Role: %s\nExtensions Context (length): %d\n",
117-
*msgContext.Messages[0].Role,
118-
len(*msgContext.Messages[0].Content))
119-
120-
fmt.Fprintf(os.Stderr, "ChatRole: %s\nChat content: %s\n",
121-
*resp.Choices[0].Message.Role,
122-
*resp.Choices[0].Message.Content,
123-
)
50+
azureOpenAIKey := os.Getenv("AOAIKey")
51+
modelDeploymentID := os.Getenv("AOAIDeploymentId")
52+
53+
// Ex: "https://<your-azure-openai-host>.openai.azure.com"
54+
azureOpenAIEndpoint := os.Getenv("AOAIEndpoint")
55+
56+
// Azure AI Search configuration
57+
searchIndex := os.Getenv("SearchIndex")
58+
searchEndpoint := os.Getenv("SearchEndpoint")
59+
searchAPIKey := os.Getenv("SearchKey")
60+
61+
if azureOpenAIKey == "" || modelDeploymentID == "" || azureOpenAIEndpoint == "" || searchIndex == "" || searchEndpoint == "" || searchAPIKey == "" {
62+
fmt.Fprintf(os.Stderr, "Skipping example, environment variables missing\n")
63+
return
64+
}
65+
66+
keyCredential := azcore.NewKeyCredential(azureOpenAIKey)
67+
68+
// In Azure OpenAI you must deploy a model before you can use it in your client. For more information
69+
// see here: https://learn.microsoft.com/azure/cognitive-services/openai/how-to/create-resource
70+
client, err := azopenai.NewClientWithKeyCredential(azureOpenAIEndpoint, keyCredential, nil)
71+
72+
if err != nil {
73+
// TODO: Update the following line with your application specific error handling logic
74+
log.Fatalf("ERROR: %s", err)
75+
}
76+
77+
resp, err := client.GetChatCompletions(context.TODO(), azopenai.ChatCompletionsOptions{
78+
Messages: []azopenai.ChatRequestMessageClassification{
79+
&azopenai.ChatRequestUserMessage{Content: azopenai.NewChatRequestUserMessageContent("What are the differences between Azure Machine Learning and Azure AI services?")},
80+
},
81+
MaxTokens: to.Ptr[int32](512),
82+
AzureExtensionsOptions: []azopenai.AzureChatExtensionConfigurationClassification{
83+
&azopenai.AzureCognitiveSearchChatExtensionConfiguration{
84+
// This allows Azure OpenAI to use an Azure AI Search index.
85+
//
86+
// > Because the model has access to, and can reference specific sources to support its responses, answers are not only based on its pretrained knowledge
87+
// > but also on the latest information available in the designated data source. This grounding data also helps the model avoid generating responses
88+
// > based on outdated or incorrect information.
89+
//
90+
// Quote from here: https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/use-your-data
91+
Parameters: &azopenai.AzureCognitiveSearchChatExtensionParameters{
92+
Endpoint: &searchEndpoint,
93+
IndexName: &searchIndex,
94+
Authentication: &azopenai.OnYourDataAPIKeyAuthenticationOptions{
95+
Key: &searchAPIKey,
96+
},
97+
},
98+
},
99+
},
100+
DeploymentName: &modelDeploymentID,
101+
}, nil)
102+
103+
if err != nil {
104+
// TODO: Update the following line with your application specific error handling logic
105+
log.Fatalf("ERROR: %s", err)
106+
}
107+
108+
// Contains contextual information from your Azure chat completion extensions, configured above in `AzureExtensionsOptions`
109+
msgContext := resp.Choices[0].Message.Context
110+
111+
fmt.Fprintf(os.Stderr, "Extensions Context Role: %s\nExtensions Context (length): %d\n",
112+
*msgContext.Messages[0].Role,
113+
len(*msgContext.Messages[0].Content))
114+
115+
fmt.Fprintf(os.Stderr, "ChatRole: %s\nChat content: %s\n",
116+
*resp.Choices[0].Message.Role,
117+
*resp.Choices[0].Message.Content,
118+
)
124119
}
125120
```
126121

@@ -136,4 +131,4 @@ ms.date: 08/29/2023
136131
The application prints the response including both answers to your query and citations from your uploaded files.
137132

138133
> [!div class="nextstepaction"]
139-
> [I ran into an issue when running the code samples.](https://microsoft.qualtrics.com/jfe/form/SV_0Cl5zkG3CnDjq6O?PLanguage=dotnet&Pillar=AOAI&Product=ownData&Page=quickstart&Section=Create-dotnet-application)
134+
> [I ran into an issue when running the code samples.](https://microsoft.qualtrics.com/jfe/form/SV_0Cl5zkG3CnDjq6O?PLanguage=dotnet&Pillar=AOAI&Product=ownData&Page=quickstart&Section=Create-dotnet-application)

articles/azure-functions/functions-reference-python.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -973,7 +973,7 @@ pip install -r requirements.txt
973973

974974
When running your functions in an [App Service plan](./dedicated-plan.md), dependencies that you define in requirements.txt are given precedence over built-in Python modules, such as `logging`. This precedence can cause conflicts when built-in modules have the same names as directories in your code. When running in a [Consumption plan](./consumption-plan.md) or an [Elastic Premium plan](./functions-premium-plan.md), conflicts are less likely because your dependencies aren't prioritized by default.
975975

976-
To prevent issues running in an App Service plan, don't name your directories the same as any Python native modules and don't including Python native libraries in your project's requirements.txt file.
976+
To prevent issues running in an App Service plan, don't name your directories the same as any Python native modules and don't include Python native libraries in your project's requirements.txt file.
977977

978978
## Publishing to Azure
979979

articles/container-registry/container-registry-tasks-overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ The power of ACR Tasks to truly enhance your container build workflow comes from
8282
You can set up an ACR task to track a dependency on a base image when it builds an application image. When the updated base image is pushed to your registry, or a base image is updated in a public repo such as in Docker Hub, ACR Tasks can automatically build any application images based on it.
8383
With this automatic detection and rebuilding, ACR Tasks saves you the time and effort normally required to manually track and update each and every application image referencing your updated base image.
8484

85-
Learn more about [base image update triggers](container-registry-tasks-base-images.md) for ACR Tasks. And learn how to trigger an image build when a base image is pushed to a container registry in the tutorial [Automate container image builds when a base image is updated in a Azure container registry](container-registry-tutorial-base-image-update.md)
85+
Learn more about [base image update triggers](container-registry-tasks-base-images.md) for ACR Tasks. And learn how to trigger an image build when a base image is pushed to a container registry in the tutorial [Automate container image builds when a base image is updated in an Azure container registry](container-registry-tutorial-base-image-update.md)
8686

8787
## Schedule a task
8888

articles/defender-for-cloud/alert-validation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Alternately, you can also use the [EICAR](https://www.eicar.org/download-anti-ma
7979
After the Microsoft Defender for Endpoint agent is installed on your machine, as part of Defender for Servers integration, follow these steps from the machine where you want to be the attacked resource of the alert:
8080

8181
1. Open a Terminal window, copy and run the following command:
82-
`curl -o ~/Downloads/eicar.com.txt`
82+
`curl -O https://secure.eicar.org/eicar.com.txt`
8383

8484
1. The Command Prompt window closes automatically. If successful, a new alert should appear in Defender for Cloud Alerts blade in 10 minutes.
8585

articles/private-link/tutorial-private-endpoint-sql-powershell.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ In this tutorial, you learn how to:
2020
> [!div class="checklist"]
2121
> * Create a virtual network and bastion host.
2222
> * Create a virtual machine.
23-
> * Create a Azure SQL server and private endpoint.
23+
> * Create an Azure SQL server and private endpoint.
2424
> * Test connectivity to the SQL server private endpoint.
2525
2626
## Prerequisites

articles/vpn-gateway/about-vpn-profile-download.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ In the **AzureVPN** folder, go to the ***azurevpnconfig.xml*** file and open it
5252
```
5353
<audience> </audience>
5454
<issuer> </issuer>
55-
<tennant> </tennant>
55+
<tenant> </tenant>
5656
<fqdn> </fqdn>
5757
<serversecret> </serversecret>
5858
```

0 commit comments

Comments
 (0)