mikebai.com

  • Home
  • dev
  • DotNET
  • M365
  • 搞笑
  • 杂七杂八
  • FocusDict
個人BLOG
it developer
M365

Sign in with Azure CLI 各种方法总结

    #region Sign in with Azure CLI 各种方法总结     # https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli         #region ok 1) 使用aad user 登录 portal     # 1) - 1 >> OK 使用网页认证画面登录     # az login     # >> You have logged into Microsoft Azure!     # >> You can close this window, or we will redirect you to the Azure CLI documents in 10 seconds.         # 1) - 2 >> OK 使用hard code 用户名密码登录     # $curLoginUserName = "xxxx@zzz.hotmail.onmicrosoft.com"     # $curLoginPsw = "yyyyy"     # $AzCred = New-Object System.Management.Automation.PSCredential($curLoginUserName, $(ConvertTo-SecureString $curLoginPsw -AsPlainText -Force))     # az login -u $AzCred.UserName -p $AzCred.GetNetworkCredential().Password     #endregion ok 1) 使用aad user 登录 portal     #region OK 2) 使用 service principal 登录 portal     # Service principals are accounts not tied to any particular user, which can have permissions on them assigned through pre-defined roles.     # Authenticating with a service principal is the best way to write secure scripts or programs,     # allowing you to apply both permissions restrictions and locally stored static credential information     # az login --service-principal -u <app-url> -p <password-or-cert> --tenant <tenant>     # code start ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓     # OutInfoLog "Sign in with a service principal."     # $Application_ID_URI = "http://servicePrincipal1-for-aks-cluster1"     # $servicePrincipal1_password = "xxxxxxxxxxxxxxxxxxxxxxx"     # az login --service-principal -u  $Application_ID_URI -p $servicePrincipal1_password --tenant "xxx-yyy-zzz-eee-xxx"     # OutInfoLog "az group list."     # # 可以取得具有权限的资源列表     # az group list     # # 因为当前spn只有acrpull/acrpush权限,所以无法获得acr信息.赋予reader权限后,可以取得acr信息     # az acr list -o table     # code start ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑     #endregion OK 2) 使用 service principal 登录 portal     #region…

2020-12-10 0comments 149hotness 0likes mikebai Read all
M365

powershell 获取本机public ip

$ip = Invoke-RestMethod http://ipinfo.io/json | Select -exp ip $ipinfo = Invoke-RestMethod http://ipinfo.io/json  $ipinfo.ip  $ipinfo.hostname  $ipinfo.city  $ipinfo.region  $ipinfo.country  $ipinfo.loc  $ipinfo.org

2020-12-07 0comments 151hotness 0likes mikebai Read all
M365

AKS,ACR,ACI是什么

AKS即Azure Kubernetes,ACR即Azure Container Registry ,ACI即Azure Container Instance,这篇文章将详细讲解这三者的基本概念。 Azure Kubernetes Service (AKS) Azure Kubernetes Service是由微软提供的一个PaaS版本的Kubernetes服务(以下简称AKS),微软的AKS为我们提供了简单的部署方式与管理操作界面。其主要具有一下几个特点: 使用者无需担心升级与故障修复问题,AKS提供简单的升级方式和自动的故障修修复 AKS服务具有高度可用性 AKS具有高度的可扩展性,可以通过命令行或UI快速的进行扩展 AKS提供API Server监控机制 AKS可以通过AAD以及RBAC来管控群集的存取安全性 AKS的服务(Master节点)由Azure进行托管并免费对用户提供使用,用户只需承担worker node的费用 这里要和大家简单的说一下,因为AKS是一款PaaS的服务,所以不需要用户去构建并维护Master节点,只需要通过Kubernetes API Endpoint使用相关的命令行工具来管理AKS。使用 AKS 配合 Azure 服务 Helm, Azure DevOps Project, ACR, ACI, Azure Monitor 提供从开发到生产环境的完整解决方案。 Azure Container Registry (ACR) 相信各位对共有的docker镜像存储仓库docker hub都很熟悉,对ACR却很陌生,其实ACR是微软提供的可以用来存储所有容器部署类型的映像,我们可以把它理解成一个私有的容器镜像仓库,这个仓库可以使用docker registry相同的命令来对其进行管理。 ACR包括一下几个主要的概念: Registry: 一个Azure订阅可以创建多个Container registries,可以通过webhook与Azure AD登录管理image,根据不通的registry类型,提供本机存储或者异地复制的使用情况。每个registry名称都是以FQDN的方式呈现的,如:REGISTRY_NAME.azurecr.io Repository:每个registry包含一个以上的repository,以群组的方式进行存储管理,并且支持多层命名空间 Image:存储于respository中,当不需要使用时,可以使用docker命令将image从repository去除 Azure Container Instance (ACI) Azure 容器执行个体 Azure Container Instance (ACI), 是不需要管理虚拟机器而提供容器应用程式执行的服务, 具有快速启动的优点, 并且提供公用 IP 以及完整网域名称 (FQDN), 可以直接由网际网路存取应用程式. 此外 ACI 具有应用程式相依性隔离和资源控管, 等同于虚拟机器的安全性管理. 如下图, ACR 提供容器的储存, 并且可以将 Image 取出到 ACI 中

2020-12-07 0comments 146hotness 0likes mikebai Read all
M365

azure RHEL 8上安装PostgreSQL 13

azure redhat vm初期设置 重置root用户密码 sudo passwd root 切换到root用户 查看主机信息 [root@pc-vm-dbsrv3 src]# hostnamectl    Static hostname: pc-vm-dbsrv3          Icon name: computer-vm            Chassis: vm         Machine ID: 7fef26f2ae4642a19e8c1bdde589500e            Boot ID: 2c4aa41a19454d41a1bd77bcbeb2fcac     Virtualization: microsoft   Operating System: Red Hat Enterprise Linux 8.1 (Ootpa)        CPE OS Name: cpe:/o:redhat:enterprise_linux:8.1:GA             Kernel: Linux 4.18.0-147.32.1.el8_1.x86_64       Architecture: x86-64 [root@pc-vm-dbsrv3 src]# 查看timezone timedatectl >>[root@pc-vm-dbsrv3 log]# timedatectl >>               Local time: Sun 2020-12-06 11:25:13 UTC >>           Universal time: Sun 2020-12-06 11:25:13 UTC >>                 RTC time: Sun 2020-12-06 11:25:13 >>                Time zone: Etc/UTC (UTC, +0000) >>System clock synchronized: yes >>              NTP service: active >>          RTC in local TZ: no >> 列出所有timezone timedatectl list-timezones 修改timezone timedatectl set-timezone Asia/Tokyo 在开始安装之前,确保正在运行最新版本的RHEL 8 系统。您可以运行yum update命令以获取最新更新。 sudo yum -y update sudo systemctl reboot 安装repos前确认启用的存储库列表。 sudo dnf repolist >>[root@pc-vm-dbsrv3 ~]# sudo dnf repolist >>Last metadata expiration check: 0:02:31 ago on Sun 06 Dec 2020 09:35:43 AM UTC. >>repo id                                                 repo name                                                                                                  status >>microsoft-azure-rhel8-eus                               Microsoft Azure RPMs for RHEL8 Extended Update Support                                                         3 >>rhel-8-for-x86_64-appstream-eus-rhui-rpms               Red Hat Ent

2020-12-06 0comments 138hotness 0likes mikebai Read all
dev

树莓派输入LineageOS手顺

0.使用BigBaiCai等恢复sd卡空间 1.安装 下载img https://konstakang.com/devices/rpi4/LineageOS17.1-ATV/ balenaEtcher或者Win32DiskImager将[ lineage-17.1-20200813-UNOFFICIAL-KonstaKANG-rpi4.img ]输入到sd中 烧录后把sd卡插入树莓派,开机启动即可 2.安装后相关设置 开启在开发者选项 Settings -> Device Preferences -> About -> Click ‘Build number’ several times. 在开发者选项中    开启 Advanced reboot (好像没有用)       Settings -> Device preferences -> About -> Restart -> Recovery进入不到recovery,还是会进入安卓系统    开启 root access    开启 本地终端     设置 不锁定屏幕 3.进入recovery/twrp系统 Local terminal下,执行以下命令重启进入recovery su rpi4-recovery.sh   (该脚本为系统内置,不需要安装) 显示"Done,reboot device!"后,输入↓ reboot 4.twrp下刷包 4.1 sd卡容量patch 因为img文件是7g卡制作,使用大于8g的卡,可能系统空间显示有问题,刷入以下img可解决 lineage-17.1-rpi-resize.zip -> https://androidfilehost.com/?fid=8889791610682901036 插入存放zip文件的usb到树莓派上, D:\OneDrive - jpfocus.com\_工控机和树莓派\_TV for_raspberry\2.lineage-17.1-rpi-resize-sdcard.zip 主页面 > Install > Select Storage > USB-OTG > 选中 Reboot after installation complete > 执行刷包 4.2谷歌apps 下载 Google apps Platform:ARM Android:10.0 Variant:tvstock https://opengapps.org/?arch=arm&api=10.0&variant=tvstock 主页面 > Install > Select Storage > USB-OTG > 选中 Reboot after installation complete > 执行刷包 D:\OneDrive - jpfocus.com\_工控机和树莓派\_TV for_raspberry\3.open_gapps-arm-10.0-tvstock-20201010.zip 刷入后wipe下,恢复到出厂设置 wipe后需要重新设置第2步的相关设置 4.3 使用twrp中高级功能>文件管理 吧es文件管理器 拷贝到sd卡download文件夹(市场中的文件管理器大部分都不支持otg usb) 注意使用free版本的最新版,旧版本可能有问题 "D:\OneDrive - jpfocus.com\_工控机和树莓派\_TV for_raspberry\app\esExplorer-free-only-this-ver-support.apk" 然后随便在市场里找个文件浏览器安装es app. 5.从recovery/twrp系统返回到安卓tv 再twrp中重启还是会回到twrp系统,无法进入安卓系统 重新回到系统需要执行以下文件刷包 "D:\OneDrive - jpfocus.com\_工控机和树莓派\_TV for_raspberry\1.lineage-17.1-rpi-recovery2boot.zip"

2020-12-02 0comments 174hotness 0likes mikebai Read all
M365

Differences between Azure SQL Database and SQL Server

Azure SQL Database is a PaaS offering and therefore some of its features differ from the on-premises SQL Server. Some of the important features that differ are as follows: Backup and Restore Conventional database backup and restore statements aren't supported. Backups are automatically scheduled and start within a few minutes of the database provisioning. Backups are consistent, transaction-wise, which means that you can do a point-in-time restore. There is no additional cost for backup storage until it goes beyond 200% of the provisioned database storage. You can reduce the backup retention period to manage backup storage costs. You can also use the long-term retention period feature to store backups in the Azure vault for a much lower cost for a longer duration. Apart from automatic backups, you can also export the Azure SQL Database bacpac or dacpac file to Azure storage. Recovery Model The default recovery model of an Azure SQL database is FULL and it can't be modified to any other recovery model as in on-premises recovery models. The recovery model is set when the master database is created, meaning when an Azure SQL server is provisioned, the recovery model can't be modified because the master database is read-only. To view the recovery model of an Azure SQL database, execute the following query: SELECT name, recovery_model_desc FROM sys.databases;

2020-12-01 0comments 121hotness 0likes mikebai Read all
M365

Azure SQL Database Managed Instance comparison to Azure SQL Database

Azure SQL Database brought many new features to SQL Server. Features such as Dynamic Data Masking, Always Encrypted, Row-Level Security, Query Store, and more. However, Azure SQL Database was built on a database scoped configuration model and has certain limitations compared to on-premises SQL Server. With the introduction of Managed Instance, we see most of those limitations removed. Managed Instance helps bridge the gap between Azure SQL Database and on-premises SQL Server due to being built on an instance scoped configuration model. In this session, we compare Azure SQL Database and Managed Instance in relation to on-premises functionality so that you will get a solid understanding of what Managed Instance has to offer. What is Azure SQL Managed Instance? https://docs.microsoft.com/en-us/azure/azure-sql/managed-instance/sql-managed-instance-paas-overview

2020-12-01 0comments 146hotness 0likes mikebai Read all
M365

Azure Arc

https://zhuanlan.zhihu.com/p/95147895 过去10年间,企业在经历了公有云的洗礼之后,从需求的角度重新衡量了“云”与业务的关系,上云并不是目的,而是提升业务创新或是效率的方式,上云并不是万能的,用合理的方式上云成为企业的共识。 这就是混合云存在的意义。 在2019年的Ignite大会上, 微软CEO Satya发布了一系列Azure新的混合云产品和服务, 而混合和多云平台Azure Arc无疑是最重磅的产品, 在Keynote里宣布了产品的公测及微软在混合云方面新的战略方向。至此在混合云的技术栈里微软不仅拥有了Azure Stack和IoT Edge, Azure云平台可以和任何数据中心, 任何云环境内的服务器资源进行管理整合。 我们来了解下什么是Azure Arc?为什么福布斯会宣称这是微软一款改变了游戏规则的产品? Azure Arc是一系列的成熟技术, 它可以帮助用户将Azure云端成熟的管理功能扩展到任何的基础架构, 而且还能够将Azure的服务运行于本地数据中心, 跨云环境和边缘节点上。成功实现了将Azure的服务和管理带到任何的基础架构。 Azure Arc在第一版的发布中会共包含了三个功能模块, 分别为跨云服务器支持, 跨云容器支持和Azure数据库服务的跨云支持, 目前跨云服务器支持已经在Azure全球版(Global Azure)提供了公测, 另两个服务正在进行内测, 在不久的将来也会和公众见面。

2020-12-01 0comments 137hotness 0likes mikebai Read all
M365

PowerShell单引号字符串和双引号字符串的区别

from https://blog.csdn.net/thinktik/article/details/81165858 输入字符串表达式时,可以使用单引号(”)或双引号(“”)括住字符串,但PowerShell解析单引号和双引号中字符串的方式是不同的。更多请看(www.omob.cc) 一、单引号括住的字符串,字符串被精确地传递到命令,字符串中包含的任何表达式都不会被计算,只会被解释成文本。例如: $varA=200 Write-host 'The value of $varA is $varA.' 1 2 3 输出为: The value of $varA is $varA. 1 变量$varA不会被相应的值替换。 二、双引号括住的字符串,在字符串传递到命令执行前,变量名会被变量值替代,表达式也会被计算。例如: 例1: $varA=200 Write-host "The value of $varA is $varA." 1 2 3 输出为: The value of 200 is 200. 1 变量$varA相应的值200替换。 例2: "The value of $(100+100) is 200" 1 输出为: The value of 200 is 200. 1 表达式$(100+100)被计算,并且结果被插入字符串中。 要避免双引号中的字符串被变量值/表达式值替换,需要在变量名/表达式前使用反单引号()。例如: $varA=200 Write-host "The value of `$varA is $varA." 1 2 3 输出为: The value of $varA is 200. 1 三、如果字符串使用单引号括起来,同时被括起的字符串中包含单引号,则需使用两个单引号,例如: 'He doesn''t want to go home.' 1 如果字符串使用双引号括起来,同时被括起的字符串中包含双引号,则需使用两个双引号,例如: "He said, ""How are you?""" 1 当然,也可以使用反单引号(`)字符来强制PowerShell将单引号或双引号解释为文本,例如: "He doesn`'t want to go home." "He said, `"How are you?`""

2020-11-30 0comments 124hotness 0likes mikebai Read all
M365

Service principal clientID not found in Active Directory tenant

https://qiita.com/dz_/items/508ce475cd267dbd950e https://stackoverflow.com/questions/47516018/creating-a-kubernetes-cluster-in-azure-fails 上記のエラーが発生したとき、 ${HOME}/.azure/acsServicePrincipal.json がある場合は、すでに Service Principal ができてるようです。 cat ${HOME}/.azure/acsServicePrincipal.json | jq {   "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx": {     "client_secret": "xxxxxxxxxxxxxxxxxxxx",     "service_principal": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"   } } Thanks for the feedback. I managed to resolve the issue by deleting my .azure folder and retrying. According to your error message, please do the follow steps to re-create AKS: 1.Check ${HOME}/.azure/.azure/acsServicePrincipal.json, find the service principal: [root@jasoncli@jasonye .azure]# pwd /root/.azure [root@jasoncli@jasonye .azure]# ls accessTokens.json  acsServicePrincipal.json  az.json  az.sess  azureProfile.json  clouds.config  config [root@jasoncli@jasonye .azure]# cat acsServicePrincipal.json {"5384xxxx-xxx-xxxx-xxxx-xxxxe29axxxx": {"client_secret": "6fc7cdff5eaf0axxxx8f", "service_principal": "6b73deca-xxxx-4a6d-ab54-73963cb78059"}} 2.Use this command to check your Service Principal, make sure the service principal exist or not: az ad sp show --id <service_principal> If the service principal not exist, we can follow this article to create it. If the service principal exist, we can follow specify the service principal and --client-secret to create AKS, like this: az aks create -g <resource_group>-n <aks name> --node-count 1 --service-principal <service_principal> --client-secret <client_secret> ----generate-ssh-key Hope this helps.

2020-11-28 0comments 114hotness 0likes mikebai Read all
1…45678…62

Recent Posts

  • c# winform适配高dpi
  • com.microsoft.sqlserver.jdbc.SQLServerException “trustServerCertificate”属性设置为“false”,但驱动程序无法使用安全套接字层 (SSL) 加密与 SQL Server建立安全连接
  • java -cp 用法介绍
  • HTML 容器元素
  • MVC的cshtml的介绍

Recent Comments

No comments to show.

COPYRIGHT © 2025 mikebai.com. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang