{"id":23459525,"url":"https://github.com/devkimchi/apim-policy-assistant","last_synced_at":"2025-04-11T21:37:47.217Z","repository":{"id":183370325,"uuid":"669991417","full_name":"devkimchi/apim-policy-assistant","owner":"devkimchi","description":"Your friendly assistant to generate Azure API Management policy documents","archived":false,"fork":false,"pushed_at":"2023-08-28T00:10:11.000Z","size":1451,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-15T23:44:20.505Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devkimchi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-07-24T03:55:00.000Z","updated_at":"2023-08-20T11:39:10.000Z","dependencies_parsed_at":"2023-07-24T07:37:21.839Z","dependency_job_id":null,"html_url":"https://github.com/devkimchi/apim-policy-assistant","commit_stats":null,"previous_names":["devkimchi/apim-policy-assistant"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devkimchi%2Fapim-policy-assistant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devkimchi%2Fapim-policy-assistant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devkimchi%2Fapim-policy-assistant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devkimchi%2Fapim-policy-assistant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devkimchi","download_url":"https://codeload.github.com/devkimchi/apim-policy-assistant/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248484942,"owners_count":21111751,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-24T06:14:52.586Z","updated_at":"2025-04-11T21:37:47.193Z","avatar_url":"https://github.com/devkimchi.png","language":"JavaScript","readme":"# Azure API Management Policy Assistant\n\nIt's your friendly assistant to generate [Azure API Management policy documents](https://learn.microsoft.com/azure/api-management/api-management-howto-policies?WT.mc_id=dotnet-102583-juyoo), using [Azure OpenAI Service](https://learn.microsoft.com/azure/ai-services/openai/overview?WT.mc_id=dotnet-102583-juyoo).\n\n## Readings\n\n- English:\n  - [GitHub Copilot for Azure API Management Policies](https://techcommunity.microsoft.com/t5/apps-on-azure-blog/github-copilot-for-azure-api-management-policies/ba-p/3884229?WT.mc_id=dotnet-102583-juyoo)\n- 한국어:\n  - [GitHub 코파일럿으로 손쉽게 APIM 정책 문서 작성하기](https://blog.aliencube.org/ko/2023/07/31/gh-copilot-for-apim-policies/)\n\n## Prerequisites\n\n- [Azure Subscription](https://azure.microsoft.com/free?WT.mc_id=dotnet-102583-juyoo)\n- [Azure OpenAI Service](https://learn.microsoft.com/azure/ai-services/openai/overview?WT.mc_id=dotnet-102583-juyoo)\n- [Azure CLI](https://learn.microsoft.com/cli/azure/what-is-azure-cli?WT.mc_id=dotnet-102583-juyoo)\n- [Azure Developer CLI](https://learn.microsoft.com/azure/developer/azure-developer-cli/overview?WT.mc_id=dotnet-102583-juyoo)\n- [GitHub CLI](https://cli.github.com)\n- [Azure Static Web Apps CLI](https://github.com/Azure/static-web-apps-cli)\n\n## Getting Started\n\n### Provisioning Azure Resources\n\n1. Fork this repository to your GitHub account, `{{GITHUB_USERNAME}}`.\n1. Run the commands below to set up a resource names:\n\n   ```bash\n   # PowerShell\n   $AZURE_ENV_NAME=\"assistant$(Get-Random -Max 9999)\"\n   $GITHUB_USERNAME=\"{{GITHUB_USERNAME}}\"\n\n   # Bash\n   AZURE_ENV_NAME=\"assistant$RANDOM\"\n   GITHUB_USERNAME=\"{{GITHUB_USERNAME}}\"\n   ```\n\n1. Run the commands below to provision Azure resources:\n\n   ```bash\n   azd auth login\n   azd init -e $AZURE_ENV_NAME\n   azd up\n   ```\n\n   \u003e You might be asked to input your GitHub username and repository name.\n\n### Deploying Applications to Azure\n\n1. Run the commands below to deploy apps to Azure:\n\n   ```bash\n   az login\n   gh auth login\n   azd pipeline config\n   gh workflow run \"Azure Dev\" --repo $GITHUB_USERNAME/apim-policy-assistant\n   ```\n\n### Deprovisioning Azure Resources\n\n1. To avoid unexpected billing shock, run the commands below to deprovision Azure resources:\n\n   ```bash\n   azd down --force --purge --no-prompt\n   ```\n\n## Local Development\n\n- On Windows, use `ApimPolicyAssistant.Win.sln` to open the solution that contains WebForm, WinForm and WPF apps.\n- On other platforms, use `ApimPolicyAssistant.sln`.\n\n### `local.settings.json` - `ApimPolicyAssistant.ApiApp`\n\n1. Copy `local.settings.sample.json` to `local.settings.json`.\n1. Substitute the following values in the `local.settings.json` with the actual values:\n\n   ```json\n   \"OpenAIApi__Endpoint\": \"https://aoai-{{AZURE_ENV_NAME}}.openai.azure.com/\",\n   \"OpenAIApi__AuthKey\": \"{{AOAI_API_KEY}}\",\n   \"OpenAIApi__DeploymentId\": \"{{DEPLOYMENT_ID}}\",\n   ```\n\n   - `{{AZURE_ENV_NAME}}`: Azure environment name. It looks like `assistant****` where `****` is a random number.\n   - `{{AOAI_API_KEY}}`: API Key of Azure OpenAI Service.\n   - `{{DEPLOYMENT_ID}}`: Azure OpenAI Service deployment ID. It looks like `model-gpt35turbo16k`.\n\n### `local.settings.json` - `ApimPolicyAssistant.ApiApp.SwaFacade`\n\n1. Copy `local.settings.sample.json` to `local.settings.json`.\n1. Substitute the following values in the `local.settings.json` with the actual values:\n\n   ```json\n   \"Apim__BaseUrl\": \"https://apim-{{AZURE_ENV_NAME}}.azure-api.net/aoai\",\n   \"Apim__SubscriptionKey\": \"{{APIM_SUBSCRIPTION_KEY}}\",\n   ```\n\n   - `{{AZURE_ENV_NAME}}`: Azure environment name. It looks like `assistant****` where `****` is a random number.\n   - `{{APIM_SUBSCRIPTION_KEY}}`: Subscription Key of Azure API Management.\n\n### `appsettings.Development.json` - `ApimPolicyAssistant.WebApp.WebForm`\n\n1. Copy `appsettings.json` to `appsettings.Development.json`.\n1. Substitute the following sections with the actual values:\n\n   ```json\n   \"Apim\": {\n     \"BaseUrl\": \"https://apim-{{AZURE_ENV_NAME}}.azure-api.net/aoai\",\n     \"SubscriptionKey\": \"{{APIM_SUBSCRIPTION_KEY}}\"\n   }\n   ```\n\n   - `{{AZURE_ENV_NAME}}`: Azure environment name. It looks like `assistant****` where `****` is a random number.\n   - `{{APIM_SUBSCRIPTION_KEY}}`: Subscription Key of Azure API Management.\n\n### `appsettings.Development.json` - `ApimPolicyAssistant.WebApp.BlazorServer`\n\n1. Copy `appsettings.json` to `appsettings.Development.json`.\n1. Substitute the following sections with the actual values:\n\n   ```json\n   \"Apim\": {\n     \"BaseUrl\": \"https://apim-{{AZURE_ENV_NAME}}.azure-api.net/aoai\",\n     \"SubscriptionKey\": \"{{APIM_SUBSCRIPTION_KEY}}\"\n   }\n   ```\n\n   - `{{AZURE_ENV_NAME}}`: Azure environment name. It looks like `assistant****` where `****` is a random number.\n   - `{{APIM_SUBSCRIPTION_KEY}}`: Subscription Key of Azure API Management.\n\n### `appsettings.Development.json` - `ApimPolicyAssistant.HybridApp.BlazorMaui`\n\n1. Copy `appsettings.json` to `appsettings.Development.json`.\n1. Substitute the following sections with the actual values:\n\n   ```json\n   \"Apim\": {\n     \"BaseUrl\": \"https://apim-{{AZURE_ENV_NAME}}.azure-api.net/aoai\",\n     \"SubscriptionKey\": \"{{APIM_SUBSCRIPTION_KEY}}\"\n   }\n   ```\n\n   - `{{AZURE_ENV_NAME}}`: Azure environment name. It looks like `assistant****` where `****` is a random number.\n   - `{{APIM_SUBSCRIPTION_KEY}}`: Subscription Key of Azure API Management.\n\n### `appsettings.Development.json` - `ApimPolicyAssistant.HybridApp.BlazorWinForm`\n\n1. Copy `appsettings.json` to `appsettings.Development.json`.\n1. Substitute the following sections with the actual values:\n\n   ```json\n   \"Apim\": {\n     \"BaseUrl\": \"https://apim-{{AZURE_ENV_NAME}}.azure-api.net/aoai\",\n     \"SubscriptionKey\": \"{{APIM_SUBSCRIPTION_KEY}}\"\n   }\n   ```\n\n   - `{{AZURE_ENV_NAME}}`: Azure environment name. It looks like `assistant****` where `****` is a random number.\n   - `{{APIM_SUBSCRIPTION_KEY}}`: Subscription Key of Azure API Management.\n\n### `appsettings.Development.json` - `ApimPolicyAssistant.HybridApp.BlazorWpf`\n\n1. Copy `appsettings.json` to `appsettings.Development.json`.\n1. Substitute the following sections with the actual values:\n\n   ```json\n   \"Apim\": {\n     \"BaseUrl\": \"https://apim-{{AZURE_ENV_NAME}}.azure-api.net/aoai\",\n     \"SubscriptionKey\": \"{{APIM_SUBSCRIPTION_KEY}}\"\n   }\n   ```\n\n   - `{{AZURE_ENV_NAME}}`: Azure environment name. It looks like `assistant****` where `****` is a random number.\n   - `{{APIM_SUBSCRIPTION_KEY}}`: Subscription Key of Azure API Management.\n\n## TO-DO\n\n- Script for local development configuration\n- [Microsoft Graph](https://developer.microsoft.com/graph?WT.mc_id=dotnet-102583-juyoo) integration\n- [Microsoft Teams](https://learn.microsoft.com/microsoftteams/platform/sbs-gs-blazorupdate?WT.mc_id=dotnet-102583-juyoo) integration\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevkimchi%2Fapim-policy-assistant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevkimchi%2Fapim-policy-assistant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevkimchi%2Fapim-policy-assistant/lists"}