It's your friendly assistant to generate Azure API Management policy documents, using Azure OpenAI Service.
- Azure Subscription
- Azure OpenAI Service
- Azure CLI
- Azure Developer CLI
- GitHub CLI
- Azure Static Web Apps CLI
-
Fork this repository to your GitHub account,
{{GITHUB_USERNAME}}
. -
Run the commands below to set up a resource names:
# PowerShell $AZURE_ENV_NAME="assistant$(Get-Random -Max 9999)" $GITHUB_USERNAME="{{GITHUB_USERNAME}}" # Bash AZURE_ENV_NAME="assistant$RANDOM" GITHUB_USERNAME="{{GITHUB_USERNAME}}"
-
Run the commands below to provision Azure resources:
azd auth login azd init -e $AZURE_ENV_NAME azd up
You might be asked to input your GitHub username and repository name.
-
Run the commands below to deploy apps to Azure:
az login gh auth login azd pipeline config gh workflow run "Azure Dev" --repo $GITHUB_USERNAME/apim-policy-assistant
-
To avoid unexpected billing shock, run the commands below to deprovision Azure resources:
azd down --force --purge --no-prompt
- On Windows, use
ApimPolicyAssistant.Win.sln
to open the solution that contains WebForm, WinForm and WPF apps. - On other platforms, use
ApimPolicyAssistant.sln
.
-
Copy
local.settings.sample.json
tolocal.settings.json
. -
Substitute the following values in the
local.settings.json
with the actual values:"OpenAIApi__Endpoint": "https://aoai-{{AZURE_ENV_NAME}}.openai.azure.com/", "OpenAIApi__AuthKey": "{{AOAI_API_KEY}}", "OpenAIApi__DeploymentId": "{{DEPLOYMENT_ID}}",
{{AZURE_ENV_NAME}}
: Azure environment name. It looks likeassistant****
where****
is a random number.{{AOAI_API_KEY}}
: API Key of Azure OpenAI Service.{{DEPLOYMENT_ID}}
: Azure OpenAI Service deployment ID. It looks likemodel-gpt35turbo16k
.
-
Copy
local.settings.sample.json
tolocal.settings.json
. -
Substitute the following values in the
local.settings.json
with the actual values:"Apim__BaseUrl": "https://apim-{{AZURE_ENV_NAME}}.azure-api.net/aoai", "Apim__SubscriptionKey": "{{APIM_SUBSCRIPTION_KEY}}",
{{AZURE_ENV_NAME}}
: Azure environment name. It looks likeassistant****
where****
is a random number.{{APIM_SUBSCRIPTION_KEY}}
: Subscription Key of Azure API Management.
-
Copy
appsettings.json
toappsettings.Development.json
. -
Substitute the following sections with the actual values:
"Apim": { "BaseUrl": "https://apim-{{AZURE_ENV_NAME}}.azure-api.net/aoai", "SubscriptionKey": "{{APIM_SUBSCRIPTION_KEY}}" }
{{AZURE_ENV_NAME}}
: Azure environment name. It looks likeassistant****
where****
is a random number.{{APIM_SUBSCRIPTION_KEY}}
: Subscription Key of Azure API Management.
-
Copy
appsettings.json
toappsettings.Development.json
. -
Substitute the following sections with the actual values:
"Apim": { "BaseUrl": "https://apim-{{AZURE_ENV_NAME}}.azure-api.net/aoai", "SubscriptionKey": "{{APIM_SUBSCRIPTION_KEY}}" }
{{AZURE_ENV_NAME}}
: Azure environment name. It looks likeassistant****
where****
is a random number.{{APIM_SUBSCRIPTION_KEY}}
: Subscription Key of Azure API Management.
-
Copy
appsettings.json
toappsettings.Development.json
. -
Substitute the following sections with the actual values:
"Apim": { "BaseUrl": "https://apim-{{AZURE_ENV_NAME}}.azure-api.net/aoai", "SubscriptionKey": "{{APIM_SUBSCRIPTION_KEY}}" }
{{AZURE_ENV_NAME}}
: Azure environment name. It looks likeassistant****
where****
is a random number.{{APIM_SUBSCRIPTION_KEY}}
: Subscription Key of Azure API Management.
-
Copy
appsettings.json
toappsettings.Development.json
. -
Substitute the following sections with the actual values:
"Apim": { "BaseUrl": "https://apim-{{AZURE_ENV_NAME}}.azure-api.net/aoai", "SubscriptionKey": "{{APIM_SUBSCRIPTION_KEY}}" }
{{AZURE_ENV_NAME}}
: Azure environment name. It looks likeassistant****
where****
is a random number.{{APIM_SUBSCRIPTION_KEY}}
: Subscription Key of Azure API Management.
-
Copy
appsettings.json
toappsettings.Development.json
. -
Substitute the following sections with the actual values:
"Apim": { "BaseUrl": "https://apim-{{AZURE_ENV_NAME}}.azure-api.net/aoai", "SubscriptionKey": "{{APIM_SUBSCRIPTION_KEY}}" }
{{AZURE_ENV_NAME}}
: Azure environment name. It looks likeassistant****
where****
is a random number.{{APIM_SUBSCRIPTION_KEY}}
: Subscription Key of Azure API Management.
- Script for local development configuration
- Microsoft Graph integration
- Microsoft Teams integration