Skip to content

Commit 124f889

Browse files
authored
Merge branch 'main' into 07Feb-MBPD
2 parents 4b02c41 + ac1f63a commit 124f889

18 files changed

+812
-270
lines changed

articles/azure-arc/data/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ items:
126126
href: troubleshoot-guide.md
127127
- name: Get logs
128128
href: troubleshooting-get-logs.md
129+
- name: Troubleshoot deployments
130+
href: troubleshoot-managed-instance.md
129131
- name: Azure Arc-enabled SQL Managed Instance
130132
items:
131133
- name: Overview
Lines changed: 218 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,218 @@
1+
---
2+
title: Troubleshoot connection to failover group - Azure Arc-enabled SQL Managed Instance
3+
description: Describes how to troubleshoot issues with connections to failover group resources in Azure Arc-enabled data services
4+
author: MikeRayMSFT
5+
ms.author: mikeray
6+
ms.topic: troubleshooting-general
7+
ms.date: 03/15/2023
8+
---
9+
10+
# Troubleshoot Azure Arc-enabled SQL Managed Instance deployments
11+
12+
This article identifies potential issues, and describes how to diagnose root causes for these issues for deployments of Azure Arc-enabled data services.
13+
14+
## Connection to Azure Arc-enabled SQL Managed Instance failover group
15+
16+
This section describes how to troubleshoot issues connecting to a failover group.
17+
18+
### Check failover group connections & synchronization state
19+
20+
```console
21+
kubectl -n $nameSpace get fog $fogName -o jsonpath-as-json='{.status}'
22+
```
23+
24+
**Results**:
25+
26+
On each side, there are two replicas for one failover group. Check the value of `connectedState`, and `synchronizationState` for each replica.
27+
28+
If one of `connectedState` isn't equal to `CONNECTED`, see the instructions under [Check parameters](#check-parameters).
29+
30+
If one of `synchronizationState` isn't equal to `HEALTHY`, focus on the instance which `synchronizationState` isn't equal to `HEALTHY`". Refer to [Can't connect to Arc-enabled SQL Managed Instance](#cant-connect-to-arc-enabled-sql-managed-instance) for how to debug.
31+
32+
### Check parameters
33+
34+
On both geo-primary and geo-secondary, check failover spec against `$sqlmiName` instance on other side.
35+
36+
### Command on local
37+
38+
Run the following command against the local instance to get the spec for the local instance.
39+
40+
```console
41+
kubectl -n $nameSpace get fog $fogName -o jsonpath-as-json='{.spec}'
42+
```
43+
44+
### Command on remote
45+
46+
Run the following command against the remote instance:
47+
48+
```console
49+
kubectl -n $nameSpace get sqlmi $sqlmiName -o jsonpath-as-json='{.status.highAvailability.mirroringCertificate}'
50+
kubectl -n $nameSpace get sqlmi $sqlmiName -o jsonpath-as-json='{.status.endpoints.mirroring}'
51+
```
52+
53+
**Results**:
54+
55+
Compare the results from the remote instance with the results from the local instance.
56+
57+
* `partnerMirroringURL`, and `partnerMirroringCert` from the local instance has to match remote instance values from:
58+
* `kubectl -n $nameSpace get sqlmi $sqlmiName -o jsonpath-as-json='{.status.endpoints.mirroring}'`
59+
* `kubectl -n $nameSpace get sqlmi $sqlmiName -o jsonpath-as-json='{.status.highAvailability.mirroringCertificate}'`
60+
61+
* `partnerMI` from `kubectl -n $nameSpace get fog $fogName -o jsonpath-as-json='{.spec}'` has to match with `$sqlmiName` from remote instance.
62+
63+
* `sharedName` from `kubectl -n $nameSpace get fog $fogName -o jsonpath-as-json='{.spec}'` is optional. If it isn't presented, it's same as `sourceMI`. The `sharedName` from both site should be same if presented.
64+
65+
* Role from `kubectl -n $nameSpace get fog $fogName -o jsonpath-as-json='{.spec}'` should be different between two sites. One side should be primary, other should be secondary.
66+
67+
If any one of values described doesn't match the comparison, delete failover group on both sites and re-create.
68+
69+
If nothing is wrong, follow the instructions under [Check mirroring endpoints for both sides](#check-mirroring-endpoints-for-both-sides).
70+
71+
### Check mirroring endpoints for both sides
72+
73+
On both geo-primary and geo-secondary, checks external mirroring endpoint is exposed by following commands.
74+
75+
```console
76+
kubectl -n test get services $sqlmiName-external-svc -o jsonpath-as-json='{.spec.ports}'
77+
```
78+
79+
**Results**
80+
81+
* `port-mssql-mirroring` should be presented on the list. The failover group on the other side should use the same value for `partnerMirroringURL`. If the values don't match, correct the mistake and retry from the beginning.
82+
83+
### Verify SQL Server can reach external endpoint of another site
84+
85+
Although you can't ping mirroring endpoint of another site directly, use the following command to reach another side external endpoint of the SQL Server tabular data stream (TDS) port.
86+
87+
```console
88+
kubectl exec -ti -n $nameSpace $sqlmiName-0 -c arc-sqlmi -- /opt/mssql-tools/bin/sqlcmd -S $remotePrimaryEndpoint -U $remoteUser -P $remotePassword -Q "SELECT @@ServerName"
89+
```
90+
91+
**Results**
92+
93+
If SQL server can use external endpoint TDS, there is a good chance it can reach external mirroring endpoint because they are defined and activated in the same service, specifically `$sqlmiName-external-svc`.
94+
95+
## Can't connect to Arc-enabled SQL Managed Instance
96+
97+
This section identifies specific steps you can take to troubleshoot connections to Azure Arc-enabled SQL managed instances.
98+
99+
> [!NOTE]
100+
> You can't connect to an Azure Arc-enabled SQL Managed Instance if the instance license type is `DisasterRecovery`.
101+
102+
### Check the managed instance status
103+
104+
SQL Managed Instance (SQLMI) status info indicates if the instance is ready or not.
105+
106+
```console
107+
kubectl -n $nameSpace get sqlmi $sqlmiName -o jsonpath-as-json='{.status}'
108+
```
109+
110+
**Results**
111+
112+
The state should be `Ready`. If the value isn't `Ready`, you need to wait. If state is error, get the message field, collect logs, and contact support. See [Collecting the logs](#collecting-the-logs).
113+
114+
### Check the routing label for stateful set
115+
The routing label for stateful set is used to route external endpoint to a matched pod. The name of the label is `role.ag.mssql.microsoft.com`.
116+
117+
```console
118+
kubectl -n $nameSpace get pods $sqlmiName-0 -o jsonpath-as-json='{.metadata.labels}'
119+
kubectl -n $nameSpace get pods $sqlmiName-1 -o jsonpath-as-json='{.metadata.labels}'
120+
kubectl -n $nameSpace get pods $sqlmiName-2 -o jsonpath-as-json='{.metadata.labels}'
121+
```
122+
123+
**Results**
124+
125+
If you didn't find primary, kill the pod that doesn't have any `role.ag.mssql.microsoft.com` label. If this doesn't resolve the issue, collect logs and contact support. See [Collecting the logs](#collecting-the-logs).
126+
127+
### Get Replica state from local container connection
128+
129+
Use `localhost,1533` to connect sql in each replica of `statefulset`. This connection should always succeed. Use this connection to query the SQL HA replica state.
130+
131+
```console
132+
kubectl exec -ti -n $nameSpace $sqlmiName-0 -c arc-sqlmi -- /opt/mssql-tools/bin/sqlcmd -S localhost,1533 -U $User -P $Password -Q "SELECT * FROM sys.dm_hadr_availability_replica_states"
133+
kubectl exec -ti -n $nameSpace $sqlmiName-1 -c arc-sqlmi -- /opt/mssql-tools/bin/sqlcmd -S localhost,1533 -U $User -P $Password -Q "SELECT * FROM sys.dm_hadr_availability_replica_states"
134+
kubectl exec -ti -n $nameSpace $sqlmiName-2 -c arc-sqlmi -- /opt/mssql-tools/bin/sqlcmd -S localhost,1533 -U $User -P $Password -Q "SELECT * FROM sys.dm_hadr_availability_replica_states"
135+
```
136+
137+
**Results**
138+
139+
All replicas should be connected & healthy. Here is the detailed description of the query results [sys.dm_hadr_availability_replica_states](/sql/relational-databases/system-dynamic-management-views/sys-dm-hadr-availability-replica-states-transact-sql).
140+
141+
If you find it isn't synchronized or not connected unexpectedly, try to kill the pod which has the problem. If problem persists, collect logs and contact support. See [Collecting the logs](#collecting-the-logs).
142+
143+
> [!NOTE]
144+
> If there are some large database in the instance, the seeding process to secondary could take a while. If this happens, wait for seeding to complete.
145+
146+
## Check SQLMI SQL engine listener
147+
148+
SQL engine listener is the component which routes connections to the failover group.
149+
150+
```console
151+
kubectl exec -ti -n $nameSpace $sqlmiName-0 -c arc-sqlmi -- /opt/mssql-tools/bin/sqlcmd -S localhost,1433 -U $User -P $Password -Q "SELECT @@ServerName"
152+
kubectl exec -ti -n $nameSpace $sqlmiName-1 -c arc-sqlmi -- /opt/mssql-tools/bin/sqlcmd -S localhost,1433 -U $User -P $Password -Q "SELECT @@ServerName"
153+
kubectl exec -ti -n $nameSpace $sqlmiName-2 -c arc-sqlmi -- /opt/mssql-tools/bin/sqlcmd -S localhost,1433 -U $User -P $Password -Q "SELECT @@ServerName"
154+
```
155+
156+
**Results**
157+
158+
You should get `ServerName` from `Listener` of each replica. If you can't get `ServerName`, kill the pods which have the problem. If the problem persists after recovery, collect logs and contact support. See [Collecting the logs](#collecting-the-logs).
159+
160+
### Check Kubernetes network connection
161+
162+
Inside Kubernetes cluster, there is kubernetes network on top which allow communication between pods and routing. Check if SQLMI pods can communicate with each other via cluster IP. Run this for all the replicas.
163+
164+
165+
```console
166+
kubectl exec -ti -n $nameSpace $sqlmiName-0 -c arc-sqlmi -- /opt/mssql-tools/bin/sqlcmd -S $(kubectl -n test get service $sqlmiName-p-svc -o jsonpath={'.spec.clusterIP'}),1533 -U $User -P $Password -Q "SELECT @@ServerName"
167+
```
168+
169+
**Results**
170+
171+
You should be able to reach any Cluster IP address for the pods of stateful set from another pod. If this isn't the case, refer to [Kubernetes documentation - Cluster networking](https://kubernetes.io/docs/concepts/cluster-administration/networking/) for detailed information or get service provider to resolve the issue.
172+
173+
### Check the Kubernetes load balancer or `nodeport` services
174+
175+
Load balancer or `nodeport` services are the services that expose a service port to the external network.
176+
177+
```console
178+
kubectl -n $nameSpace expose pod $sqlmiName-0 --port=1533 --name=ha-$sqlmiName-0 --type=LoadBalancer
179+
kubectl -n $nameSpace expose pod $sqlmiName-1 --port=1533 --name=ha-$sqlmiName-1 --type=LoadBalancer
180+
kubectl -n $nameSpace expose pod $sqlmiName-2 --port=1533 --name=ha-$sqlmiName-2 --type=LoadBalancer
181+
```
182+
183+
**Results**
184+
185+
You should be able to connect to exposed external port (which has been confirmed from internal at step 3). If you can't connect to external port, refer to [Kubernetes documentation - Create an external load balancer](https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/) and get service provider help on the issues.
186+
187+
You can use any client like `SqlCmd`, SQL Server Management Studio (SSMS), or Azure Data Studio (ADS) to test this out.
188+
189+
## Collecting the logs
190+
191+
If the previous steps all succeeded without any problem and you still can't log in, collect the logs and contact support
192+
193+
### Collection controller logs
194+
195+
```console
196+
MyController=$(kubectl -n $nameSpace get pods --selector=app=controller -o jsonpath='{.items[*].metadata.name}')
197+
kubectl -n $nameSpace cp $MyController:/var/log/controller $localFolder/controller -c controller
198+
```
199+
200+
### Get SQL Server and supervisor logs for each replica
201+
202+
Run the following command for each replica to get SQL Server and supervisor logs
203+
204+
```console
205+
kubectl -n $nameSpace cp $sqlmiName-0:/var/opt/mssql/log $localFolder/$sqlmiName-0/log -c arc-sqlmi
206+
kubectl -n $nameSpace cp $sqlmiName-0:/var/log/arc-ha-supervisor $localFolder/$sqlmiName-0/arc-ha-supervisor -c arc-ha-supervisor
207+
```
208+
209+
### Get orchestrator logs
210+
211+
```console
212+
kubectl -n $nameSpace cp $sqlmiName-ha-0:/var/log $localFolder/$sqlmiName-ha-0/log -c arc-ha-orchestrator
213+
```
214+
215+
216+
## Next steps
217+
218+
[Get logs to troubleshoot Azure Arc-enabled data services](troubleshooting-get-logs.md)

articles/azure-functions/functions-reference.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Guidance for developing Azure Functions
2+
title: Guidance for developing Azure Functions
33
description: Learn the Azure Functions concepts and techniques that you need to develop functions in Azure, across all programming languages and bindings.
44
ms.assetid: d8efe41a-bef8-4167-ba97-f3e016fcd39e
55
ms.topic: conceptual
@@ -43,7 +43,7 @@ The `bindings` property is where you configure both triggers and bindings. Each
4343
| name | Function identifier.<br><br>For example, `myQueue`. | string | The name that is used for the bound data in the function. For C#, this is an argument name; for JavaScript, it's the key in a key/value list. |
4444

4545
## Function app
46-
A function app provides an execution context in Azure in which your functions run. As such, it is the unit of deployment and management for your functions. A function app is comprised of one or more individual functions that are managed, deployed, and scaled together. All of the functions in a function app share the same pricing plan, deployment method, and runtime version. Think of a function app as a way to organize and collectively manage your functions. To learn more, see [How to manage a function app](functions-how-to-use-azure-function-app-settings.md).
46+
A function app provides an execution context in Azure in which your functions run. As such, it is the unit of deployment and management for your functions. A function app is comprised of one or more individual functions that are managed, deployed, and scaled together. All of the functions in a function app share the same pricing plan, deployment method, and runtime version. Think of a function app as a way to organize and collectively manage your functions. To learn more, see [How to manage a function app](functions-how-to-use-azure-function-app-settings.md).
4747

4848
> [!NOTE]
4949
> All functions in a function app must be authored in the same language. In [previous versions](functions-versions.md) of the Azure Functions runtime, this wasn't required.
@@ -105,7 +105,7 @@ For example, the `connection` property for an Azure Blob trigger definition migh
105105

106106
> [!NOTE]
107107
> When using [Azure App Configuration](../azure-app-configuration/quickstart-azure-functions-csharp.md) or [Key Vault](../key-vault/general/overview.md) to provide settings for Managed Identity connections, setting names should use a valid key separator such as `:` or `/` in place of the `__` to ensure names are resolved correctly.
108-
>
108+
>
109109
> For example, `Storage1:blobServiceUri`.
110110
111111
### Configure an identity-based connection
@@ -122,7 +122,8 @@ Identity-based connections are supported by the following components:
122122
| Azure Event Hubs triggers and bindings | All | [Azure Event Hubs extension version 5.0.0 or later][eventhubv5],<br/>[Extension bundle 3.3.0 or later][eventhubv5] |
123123
| Azure Service Bus triggers and bindings | All | [Azure Service Bus extension version 5.0.0 or later][servicebusv5],<br/>[Extension bundle 3.3.0 or later][servicebusv5] |
124124
| Azure Cosmos DB triggers and bindings | All | [Azure Cosmos DB extension version 4.0.0 or later][cosmosv4],<br/> [Extension bundle 4.0.2 or later][cosmosv4]|
125-
| Durable Functions storage provider (Azure Storage) | All | [Durable Functions extension version 2.7.0 or later][durable-identity],<br/>[Extension bundle 3.3.0 or later][durable-identity] |
125+
| Azure SignalR triggers and bindings | All | [Azure SignalR extension version 1.7.0 or later][signalr] <br/>[Extension bundle 3.6.1 or later][signalr] |
126+
| Durable Functions storage provider (Azure Storage) | All | [Durable Functions extension version 2.7.0 or later][durable-identity],<br/>[Extension bundle 3.3.0 or later][durable-identity] |
126127
| Host-required storage ("AzureWebJobsStorage") - Preview | All | [Connecting to host storage with an identity](#connecting-to-host-storage-with-an-identity-preview) |
127128

128129
[blobv5]: ./functions-bindings-storage-blob.md#install-extension
@@ -131,6 +132,7 @@ Identity-based connections are supported by the following components:
131132
[servicebusv5]: ./functions-bindings-service-bus.md
132133
[cosmosv4]: ./functions-bindings-cosmosdb-v2.md?tabs=extensionv4
133134
[tablesv1]: ./functions-bindings-storage-table.md#table-api-extension
135+
[signalr]: ./functions-bindings-signalr-service.md#install-extension
134136
[durable-identity]: ./durable/durable-functions-configure-durable-functions-with-credentials.md
135137

136138
[!INCLUDE [functions-identity-based-connections-configuration](../../includes/functions-identity-based-connections-configuration.md)]
@@ -161,6 +163,8 @@ Choose a tab below to learn about permissions for each component:
161163

162164
[!INCLUDE [functions-cosmos-permissions](../../includes/functions-cosmos-permissions.md)]
163165

166+
# [Azure SignalR extension](#tab/signalr)
167+
You'll need to create a role assignment that provides access to Azure SignalR Service data plane REST APIs. We recommend you to use the built-in role [SignalR Service Owner](../role-based-access-control/built-in-roles.md#signalr-service-owner). Management roles like [Owner](../role-based-access-control/built-in-roles.md#owner) aren't sufficient.
164168

165169
# [Durable Functions storage provider (preview)](#tab/durable)
166170

@@ -186,7 +190,7 @@ Additional options may be supported for a given connection type. Please refer to
186190
##### Local development with identity-based connections
187191

188192
> [!NOTE]
189-
> Local development with identity-based connections requires updated versions of the [Azure Functions Core Tools](./functions-run-local.md). You can check your currently installed version by running `func -v`. For Functions v3, use version `3.0.3904` or later. For Functions v4, use version `4.0.3904` or later.
193+
> Local development with identity-based connections requires updated versions of the [Azure Functions Core Tools](./functions-run-local.md). You can check your currently installed version by running `func -v`. For Functions v3, use version `3.0.3904` or later. For Functions v4, use version `4.0.3904` or later.
190194
191195
When running locally, the above configuration tells the runtime to use your local developer identity. The connection will attempt to get a token from the following locations, in order:
192196

@@ -207,7 +211,7 @@ In some cases, you may wish to specify use of a different identity. You can add
207211
| Client ID | `<CONNECTION_NAME_PREFIX>__clientId` | The client (application) ID of an app registration in the tenant. |
208212
| Client secret | `<CONNECTION_NAME_PREFIX>__clientSecret` | A client secret that was generated for the app registration. |
209213

210-
Here is an example of `local.settings.json` properties required for identity-based connection to Azure Blobs:
214+
Here is an example of `local.settings.json` properties required for identity-based connection to Azure Blobs:
211215

212216
```json
213217
{

0 commit comments

Comments
 (0)