{"id":21355213,"url":"https://github.com/jlucaspains/azdiff","last_synced_at":"2025-07-09T09:35:13.290Z","repository":{"id":210129826,"uuid":"725813777","full_name":"jlucaspains/azdiff","owner":"jlucaspains","description":"A .NET CLI tool for deep Azure resource comparison.","archived":false,"fork":false,"pushed_at":"2024-10-25T00:28:14.000Z","size":66,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-26T13:15:12.153Z","etag":null,"topics":["azure","devops","dotnet"],"latest_commit_sha":null,"homepage":"","language":"C#","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/jlucaspains.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-30T23:34:50.000Z","updated_at":"2024-10-25T00:28:10.000Z","dependencies_parsed_at":"2024-05-29T01:25:15.020Z","dependency_job_id":"91796d5f-b402-456e-a9ef-4ec564b18ab2","html_url":"https://github.com/jlucaspains/azdiff","commit_stats":null,"previous_names":["jlucaspains/azdiff"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlucaspains%2Fazdiff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlucaspains%2Fazdiff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlucaspains%2Fazdiff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlucaspains%2Fazdiff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jlucaspains","download_url":"https://codeload.github.com/jlucaspains/azdiff/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225839597,"owners_count":17532308,"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":["azure","devops","dotnet"],"created_at":"2024-11-22T04:16:04.899Z","updated_at":"2024-11-22T04:16:05.681Z","avatar_url":"https://github.com/jlucaspains.png","language":"C#","readme":"# azdiff\n`azdiff` is a command-line tool designed to perform deep comparisons between Azure resources.\n\n## Installation\n```powershell\ndotnet tool install --global lpains.azdiff --prerelease\n```\n\n## General usage\nUpon installation, access the tool by executing `azdiff` in your terminal. For specific command details, refer to the sections below or utilize the CLI help via `azdiff -h`.\n\nThe commands provided typically require a source and a target, generating a distinct `.diff` file for each identified and compared resource.\n\n## azdiff arm\nFacilitates the comparison between two ARM template files, analyzing Azure resources present in each file and generating one `.diff` file per resource illustrating the differences between the source and target resources.\n\n```powershell\n  azdiff arm --sourceFile\n             --targetFile\n             [--outputFolder]\n             [--ignoreType]\n             [--replaceStringsFile]\n             [-?, -h, --help]\n```\n\n### Examples\nBasic usage:\n```powershell\nazdiff arm --sourceFile .\\source.json `\n           --targetFile .\\target.json\n```\n\nAdvanced usage:\n```powershell\nazdiff arm --sourceFile .\\source.json `\n           --targetFile .\\target.json `\n           --ignoreType \"Microsoft.Web/staticSites/customDomains\" `\n           --ignoreType \"Microsoft.Web/staticSites/databaseConnections\" `\n           --replaceStringsFile .\\replaceStrings.json\n```\n\nOutput file (diff_stapp-blog-centralus-001.diff):\n```diff\n  {\n    \"type\": \"Microsoft.Web/staticSites\",\n    \"apiVersion\": \"2023-01-01\",\n    \"name\": \"stapp-blog-centralus-001\",\n    \"location\": \"Central US\",\n    \"sku\": {\n      \"name\": \"Free\",\n      \"tier\": \"Free\"\n    },\n    \"properties\": {\n      \"repositoryUrl\": \"https://github.com/jlucaspains/blog-v2\",\n-     \"branch\": \"v1\",\n+     \"branch\": \"release/v1\",\n      \"stagingEnvironmentPolicy\": \"Enabled\",\n      \"allowConfigFileUpdates\": true,\n      \"provider\": \"GitHub\",\n      \"enterpriseGradeCdnStatus\": \"Disabled\"\n    }\n  }\n\n```\n\n### Parameters\n#### `--sourceFile` (required)\n\nThe comparison source json file. It should be an exported ARM template.\n\n#### `--targetFile` (required)\n\nThe comparison target json file. It should be an exported ARM template.\n\n#### `--outputFolder`\n\nThe folder path for output. Defaults to `diffs`.\n\n#### `--ignoreType`\n\nA list of types to ignore in the ARM comparison. You may use this option multiple times.\n\n#### `--replaceStringsFile`\n\nJSON file containing replacement strings. Example:\n\n```json\n[\n    {\n        \"target\": \"Name\",\n        \"input\": \"DEV\",\n        \"replacement\": \"env\"\n    }\n]\n```\n\nThe `target` property indicates whether the name (target: Name) property or the whole file (target: Body) will apply replacements. This is particularly useful when dealing with environment comparison (e.g.: DEV vs TEST) where the resource names or parts of its json will differ in a predictable way.\n\n## azdiff rg\nFacilitates the comparison between two Azure Resource Groups, analyzing Azure resources present in each resource group and generating one `.diff` file per resource illustrating the differences between the source and target resources.\n\n```powershell\n  azdiff rg --sourceResourceGroupId\n             --targetResourceGroupId\n             [--outputFolder]\n             [--ignoreType]\n             [--replaceStringsFile]\n             [--authenticationMethod]\n             [-?, -h, --help]\n```\n\n### Azure Authentication\nThe `azdiff rg` uses the DefaultAzureCredential credential provider to authenticate with Azure. It will try a series of authentication methods and use the first successful one or an interactive session if none of the methods succeed.\n\nFor more information, see [Authenticate with Azure libraries for .NET](https://learn.microsoft.com/en-us/dotnet/api/overview/azure/identity-readme?view=azure-dotnet).\n\n### Examples\nBasic usage:\n```powershell\nazdiff rg --sourceResourceGroupId /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-dev-001 `\n          --targetResourceGroupId /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-test-001\n```\n\nAdvanced usage:\n```powershell\nazdiff rg --sourceResourceGroupId /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-dev-001 `\n          --targetResourceGroupId /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-test-001 `\n          --ignoreType \"Microsoft.Web/staticSites/customDomains\" `\n          --ignoreType \"Microsoft.Web/staticSites/databaseConnections\" `\n          --replaceStringsFile .\\replaceStrings.json\n```\n\nOutput file (diff_stapp-blog-centralus-001.diff):\n```diff\n  {\n    \"type\": \"Microsoft.Web/staticSites\",\n    \"apiVersion\": \"2023-01-01\",\n    \"name\": \"stapp-blog-centralus-001\",\n    \"location\": \"Central US\",\n    \"sku\": {\n      \"name\": \"Free\",\n      \"tier\": \"Free\"\n    },\n    \"properties\": {\n      \"repositoryUrl\": \"https://github.com/jlucaspains/blog-v2\",\n-     \"branch\": \"v1\",\n+     \"branch\": \"release/v1\",\n      \"stagingEnvironmentPolicy\": \"Enabled\",\n      \"allowConfigFileUpdates\": true,\n      \"provider\": \"GitHub\",\n      \"enterpriseGradeCdnStatus\": \"Disabled\"\n    }\n  }\n\n```\n\n### Parameters\n#### `--sourceResourceGroupId` (required)\n\nThe comparison source resource group id.\n\n#### `--targetResourceGroupId` (required)\n\nThe comparison target resource group id.\n\n#### `--outputFolder`\nThe folder path for output. Defaults to `diffs`.\n\n#### `--ignoreType`\nA list of types to ignore in the ARM comparison. You may use this option zero to multiple times.\n\n#### `--replaceStringsFile`\nJSON file containing replacement strings. Example:\n\n```json\n[\n    {\n        \"target\": \"Name\",\n        \"input\": \"DEV\",\n        \"replacement\": \"env\"\n    }\n]\n```\n\n#### `--authenticationMethod`\nAuthentication method for connecting to Azure Resource Manager. Default value is DefaultAzureCredential.\n\nValid options are:\n1. [DefaultAzureCredential](https://learn.microsoft.com/en-us/dotnet/api/azure.identity.DefaultAzureCredential?view=azure-dotnet)\n2. [EnvironmentCredential](https://learn.microsoft.com/en-us/dotnet/api/azure.identity.EnvironmentCredential?view=azure-dotnet)\n3. [WorkloadIdentityCredential](https://learn.microsoft.com/en-us/dotnet/api/azure.identity.WorkloadIdentityCredential?view=azure-dotnet)\n4. [ManagedIdentityCredential](https://learn.microsoft.com/en-us/dotnet/api/azure.identity.ManagedIdentityCredential?view=azure-dotnet)\n5. [SharedTokenCacheCredential](https://learn.microsoft.com/en-us/dotnet/api/azure.identity.SharedTokenCacheCredential?view=azure-dotnet)\n6. [VisualStudioCredential](https://learn.microsoft.com/en-us/dotnet/api/azure.identity.VisualStudioCredential?view=azure-dotnet)\n7. [VisualStudioCodeCredential](https://learn.microsoft.com/en-us/dotnet/api/azure.identity.VisualStudioCodeCredential?view=azure-dotnet)\n8. [AzureCliCredential](https://learn.microsoft.com/en-us/dotnet/api/azure.identity.AzureCliCredential?view=azure-dotnet)\n9. [AzurePowerShellCredential](https://learn.microsoft.com/en-us/dotnet/api/azure.identity.AzurePowerShellCredential?view=azure-dotnet)\n10. [AzureDeveloperCliCredential](https://learn.microsoft.com/en-us/dotnet/api/azure.identity.AzureDeveloperCliCredential?view=azure-dotnet)\n11. [InteractiveBrowserCredential](https://learn.microsoft.com/en-us/dotnet/api/azure.identity.InteractiveBrowserCredential?view=azure-dotnet)\n\nThe `target` property indicates whether the name (target: Name) property or the whole file (target: Body) will apply replacements. This is particularly useful when dealing with environment comparison (e.g.: DEV vs TEST) where the resource names or parts of its json will differ in a predictable way.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjlucaspains%2Fazdiff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjlucaspains%2Fazdiff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjlucaspains%2Fazdiff/lists"}