If you want to get tenant ID of the domain associated with Azure Active Directory / Entra ID you can quickly check it by checking OpenID configuration. Just use the link:
and replace the domain you’re checking. In a result you will receive OpenID configuration, if exists, for such domain and in the token_endpoint URL you will find tenant ID to be a part of the URL, for example
Recently I’ve been having some issues with Python Azure Functions that after deployment the underlying container was down. Redeployment, restart doesn’t help and still you can see this screen.
After some investigation I’ve found out in Azure Function “Availability and Performance” diagnostics that there is a following error:
ERROR: unhandled error in functions worker: Descriptors cannot not be created directly.
After further checks it looks like it’s related to the profobuf library. Even though I’m not using it directly it looks like some of the libraries is using this library.
Solution
Add proper version to your requirements.txt file:
protobuf==3.20.*
and redeploy the app. This solution solved my problem.
Function isEmail(ByVal email as string) as boolean
Static emailRegex As New Regex("^[_a-z0-9-]+(.[a-z0-9-]+)@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,4})$")
return emailRegex.IsMatch(email)
End Function
select email
from table_name where
patindex ('%[ &'',":;!+=\/()<>]%', email) > 0 -- Invalid characters
or patindex ('[@.-_]%', email) > 0 -- Valid but cannot be starting character
or patindex ('%[@.-_]', email) > 0 -- Valid but cannot be ending character
or email not like '%@%.%' -- Must contain at least one @ and one .
or email like '%..%' -- Cannot have two periods in a row
or email like '%@%@%' -- Cannot have two @ anywhere
or email like '%.@%' or email like '%@.%' -- Cannot have @ and . next to each other
or email like '%.cm' or email like '%.co' -- Camaroon or Colombia? Typos.
or email like '%.or' or email like '%.ne' -- Missing last letter
Oracle PL/SQL Email Regex
SELECT email
FROM table_name
WHERE REGEXP_LIKE (email, '[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}');
MySQL
SELECT * FROM `users` WHERE `email` NOT REGEXP '^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$';
Disclaimer: this is a copy of the page emailregex.com which unfortunately became unavailable, so I’ve decided to restore it’s content on my website as it’s very useful!
Saved me several times. Great and easy to follow approach by anthonysomerset.
When using PyEnv just change the location from which you copy the file (copy the lib step).
# Install Python
brew install python@3.9
# install latest azure-function-core-tools from brew
brew install azure-functions-core-tools@4
# Install grpcio inside python3.9
pip3.9 install grpcio
# copy the lib
cp /opt/homebrew/lib/python3.9/site-packages/grpc/_cython/cygrpc.cpython-39-darwin.so /opt/homebrew/Cellar/azure-functions-core-tools@4/4.0.4915/workers/python/3.9/OSX/X64/grpc/_cython/cygrpc.cpython-39-darwin.so
# symlink X64 to Arm64
cd /opt/homebrew/Cellar/azure-functions-core-tools@4/4.0.4915/workers/python/3.9/OSX/
ln -s X64 Arm64
#edit the worker config to reference arm64
cd /opt/homebrew/Cellar/azure-functions-core-tools@4/4.0.4915/workers/python
#use your text editor of choice e.g. nano
nano worker.config.json
# update supportedArchitectures like so
"supportedArchitectures":["X64", "X86","ARM64"],
# save and exit
# in your function directory setup a python 3.9 venv
cd <path to azure functions code>
python3.9 -m venv .venv
source .venv/bin/activate
# start func
func start
##[error]The nuget command failed with exit code(1) and error(Problem starting the plugin 'C:\vsts-agents\smh-agent-3\_work\_tasks\NuGetCommand_333b11bd-d341-40d9-afcf-b32d5ce6f23b\2.211.0\CredentialProviderV2\plugins\netfx\CredentialProvider.Microsoft\CredentialProvider.Microsoft.exe'. Plugin 'CredentialProvider.Microsoft' failed within 6.581 seconds with exit code -1.
This annoying error was intermittent and happened mostly when several builds were running.
I’m using two steps related to NuGet: – NuGet tool installer v1 – NuGet v2 – configured for restoring packages for the project
I’ve discovered this thread on Visual Studio Developer Community that suggest that it may be an issue with default NuGet timeout, which is 5 seconds.
The suggestion is to increase the default timeout, which works for me.
I’ve set within build variables two new variables and so far it works better – no more CredentialProvider.Microsoft error.
If you have multiple Active Directory tenants you work with and you’d like to use Microsoft Graph Explorer to interact with Microsoft Graph API you often have a need to switch between tenants.
Unfortunately, as of now, Microsoft Graph Explorer does not support switching tenant in their standard view. There is a workaround though!
If you are already signed in with your main tenant, you will have to switch account – click on your profile and then Sign in with a different account. If you have account on the other tenant you should be able to switch account. After doing so, the information about the tenant (next to you profile) should be updated!
When you use Azure DevOps to deploy your projects you can connect it to Azure via different methods. The most convenient type of service connection is `Azure Resource Manager using service principal authentication`.
This type of connection creates application in your Azure Active Directory which is used as a Service Principal. Then for this application secret is generated, so Azure DevOps can connect to Azure. This secret token is expiring from time to time. The default time to live is 2 years but it may vary.
Once the secret is expired you will get this type of error when trying to deploy your code to Azure:
##[error]Error: Failed to get resource ID for resource type 'Microsoft.Web/Sites' and resource name 'XXX'. Error: Could not fetch access token for Azure. Verify if the Service Principal used is valid and not expired. For more information refer https://aka.ms/azureappservicedeploytsg
Go to your SendGrid account and go to API Keys section.
Add new API Key with, at least, Mail Send permission.
Copy generated API Key. Your key should start with SG.
Grafana setup
You have to edit Grafana configuration. Refer to Grafana Configuration documentation on where to find your config file. For Bitnami Grafana distribution you can find it here: /opt/bitnami/grafana/conf/grafana.ini
Look for [smtp] section and either update existing one or add new one
from_adress – looks like you can put anything you want but I would recommend to put verified email address you have in SendGrid – check the Sender Authentication section.