You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: netapp_dataops_traditional/docs/anf_mcp_server_readme.md
+28-32Lines changed: 28 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,45 +47,39 @@ After installation, the `netapp_dataops_anf_mcp.py` command will be available in
47
47
48
48
### Azure Authentication
49
49
50
-
The MCP server uses **Azure CLI authentication**(`AzureCliCredential`) and automatically retrieves your subscription ID from the active Azure CLI session.
50
+
The MCP server uses **`DefaultAzureCredential`**from `azure-identity`, which automatically selects the appropriate credential based on the environment — no configuration required. The active subscription is resolved via the Azure SDK's `SubscriptionClient`.
51
51
52
-
#### Required Setup
53
-
54
-
1.**Install Azure CLI**: Follow the [installation guide](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli)
52
+
> **No secrets or environment variables are required.** The credential resolves automatically based on the environment.
55
53
56
-
2.**Login to Azure**:
57
-
```bash
58
-
az login
59
-
```
54
+
#### Required Setup
60
55
61
-
3.**If you have access to multiple tenants, specify the tenant ID**:
62
-
```bash
63
-
az login --tenant <TENANT-ID>
64
-
```
56
+
Authenticate once via Azure CLI:
65
57
66
-
4.**If you have multiple subscriptions, set the active one**:
67
-
```bash
68
-
az account set --subscription <SUBSCRIPTION_ID>
69
-
```
58
+
```bash
59
+
# Login to Azure (opens browser)
60
+
az login
70
61
71
-
5.**Verify your active subscription**:
72
-
```bash
73
-
az account show
74
-
```
62
+
# If you have access to multiple tenants, specify the tenant ID
63
+
az login --tenant <TENANT_ID>
75
64
76
-
#### How It Works
65
+
# If you have multiple subscriptions, set the active one
66
+
az account set --subscription <SUBSCRIPTION_ID>
77
67
78
-
- The MCP server automatically runs `az account show` to detect your active subscription
79
-
- Subscription ID is retrieved dynamically on each operation
80
-
- Respects your Azure CLI tenant and subscription context
81
-
- No need to configure or store subscription ID in config files or environment variables
68
+
# Verify active session (optional – subscription is auto-detected via the SDK)
69
+
az account show
70
+
```
82
71
83
-
#### Benefits
72
+
**How It Works:**
73
+
-`DefaultAzureCredential` is instantiated and passed to `SubscriptionClient`
74
+
- The first available subscription is resolved via the Azure SDK
75
+
- The resolved `subscription_id` is used to initialize `NetAppManagementClient`
76
+
- The client is cached in a singleton (`ANFClientManager`) and reused across calls
84
77
85
-
-**Simplified Setup**: No subscription ID in config files or function parameters
86
-
-**Better Security**: Subscription ID not stored anywhere
87
-
-**Multi-Tenant Support**: Easy switching between tenants/subscriptions with Azure CLI
88
-
-**Automatic Detection**: Works seamlessly with your Azure CLI context
78
+
**Benefits:**
79
+
-**Zero secrets** – No `AZURE_CLIENT_ID`, `AZURE_CLIENT_SECRET`, or `AZURE_TENANT_ID` needed
80
+
-**Portable** – Works in local dev, CI/CD, containers, and Azure-hosted environments
81
+
-**Subscription auto-resolved** – No subscription ID in config files or function parameters
@@ -130,7 +124,7 @@ The configuration file is stored at `~/.netapp_dataops/anf_config.json` and cont
130
124
}
131
125
```
132
126
133
-
> **📝 Note:** The subscription ID is **not** stored in the configuration file. It is automatically retrieved from your active Azure CLI session using `az account show`.
127
+
> **📝 Note:** The subscription ID is **not** stored in the configuration file. It is automatically resolved at runtime via `DefaultAzureCredential` and the Azure SDK's `SubscriptionClient`.
The ANF module uses **Azure CLI authentication**(`AzureCliCredential`) and automatically retrieves your subscription ID from the active Azure CLI session.
107
+
The ANF module uses **`DefaultAzureCredential`**from `azure-identity`, which automatically chains through multiple authentication methods without requiring any environment variables or secrets. The active subscription is resolved via the Azure SDK's `SubscriptionClient`.
- ✅ **Multi-subscription Support**: Honors `az account set --subscription`
142
-
- ✅ **Consistent Authentication**: Uses same credentials as Azure CLI
143
-
144
-
**Note:** Service Principal and environment variable authentication methods are no longer supported. The module now exclusively uses Azure CLI authentication for consistency and security.
145
+
-**Zero secrets** – No `AZURE_CLIENT_ID`, `AZURE_CLIENT_SECRET`, or `AZURE_TENANT_ID` needed
146
+
-**Portable** – Works in local dev, CI/CD, containers, and Azure-hosted environments
147
+
-**Subscription auto-resolved** – No subscription ID in config files or function parameters
-**Version control friendly** - Config file can be shared across teams
191
196
192
197
### Configuration File Location
193
198
@@ -209,7 +214,7 @@ The configuration is automatically saved to:
209
214
}
210
215
```
211
216
212
-
**Note:** Subscription ID is not stored in the config file. It's automatically retrieved from your Azure CLI session via `az account show`.
217
+
**Note:** Subscription ID is not stored in the config file. It's automatically resolved at runtime via `DefaultAzureCredential` and the Azure SDK's `SubscriptionClient`.
0 commit comments