Comments (4)
Hold on,
I am currently investigating whether this strange behavior is due to the SQL Server/Database setup when it comes to the servers own managed identity and its assignment of role Directory Readers.
As per doc here:
Enable service principals to create Azure AD users
and here:
Managed identities in Azure AD for Azure SQL
Meanwhile, may I suggest that you add these references on your quickstarts page relating to Azure SQL Database Getting Started / Database setup / Azure SQL database
from durabletask-mssql.
@cgillum
Hello again,
RESOLUTION
I have found that (at least when using Azure SQL Database as SQL Server of the provider) if you want to use another SQL server user than the sql server admin (sa
or of equivalent sql server priviliges) you need to add that user to the master
database as well and add it to the role dbmanager
. Otherwise the automatic schema checking and updating wont work.
This holds regardless whether the user in DurableDB
is of role db_owner
or dt_runtime
, and regardless whether it is a Managed Identity from EXTERNAL PROVIDER
or FOR
a SQL server managed login.
Is this intentional?
If so, I propose such instructions are added to the quickstart/azure-sql-database page, and the multitenancy/managing-user-credentials page.
USE [DurableDB]; -- does not work, so run in this DB manually using SSMS or the like
CREATE USER [username] FOR [login]/FROM EXTERNAL PROVIDER;
ALTER ROLE db_owner/dt_runtime ADD MEMBER [username];
USE [master]; -- does not work, so run in this DB manually using SSMS or the like
CREATE USER [username] FOR [login]/FROM EXTERNAL PROVIDER;
ALTER ROLE dbmanager ADD MEMBER [username];
GO
The USE
sql statements above actually doesn't work on SQL Database since it does not allow that statement.
I guess another way, that I haven't tried, would be to only run with "createDatabaseIfNotExists": true
initially with a sql server admin
role, and the with "createDatabaseIfNotExists": false
when using dt_runtime
role. It is however unlikely that you could assume sql server admin access in enterprise environments, and it also raises questions as to how schema updates would be managed.
from durabletask-mssql.
Hi @andsj073. I think what you're describing is a behavior/requirement of Azure SQL Database and isn't specific to this project. However, I think fundamentally what you're looking for is detailed instructions (or even a tool) to help with the initial setup? Is that correct?
I don't think there's a way to remove the requirement for admin credentials when creating the database or setting up the users/roles. However, we may be able to streamline the process so that a DB admin can use a simple script to do the one-time setup and allow the developer to then just use the created database. Would that address your concerns?
from durabletask-mssql.
Hi @cgillum
I merely meant that your instructions are missing the piece that the user, by which the Function App (that runs Durable Functions w Azure SQL Database as taskhub provider) authenticates with SQL Database, needs to be dbmanager as well in "master", not only db_owner or dt_runtime of "DurableDB"
from durabletask-mssql.
Related Issues (20)
- Exception is not propagated to parent orchestration as expected HOT 5
- Explicit taskHub parameter for stored procedures HOT 4
- Payloads as varchar and charset of payloads HOT 7
- Always encrypted support HOT 6
- Fully scripted deployment not easy with the dt_rutime role added at runtime HOT 4
- Pagination become slow when alot of orchestration HOT 1
- Configurable minimum for backoff retry for polling interval HOT 1
- chatty azure insights traces HOT 3
- Add AzFunctions' Scale Controller support for managed identity HOT 1
- Multiple ExecutionCompletedEvent found HOT 9
- Feedback KEDA HOT 2
- Terminate Pending orchestration HOT 1
- Prevent termination of pods with long-running functions using KEDA HOT 2
- Incorrect Calculation of GetRecommendedScale due to UTC/Local Time formats in tables HOT 4
- SqlUtils doesn't support suspending HOT 4
- Azure SQL transient error HOT 3
- Lost Events HOT 10
- await operator on non-OrchestrationContext tasks leaves Instance in perpetual running state HOT 2
- Instance ID should be 256 char HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from durabletask-mssql.